import request from '@/utils/request'

// 获取我的申报记录
export function findMyLaunchSealnoFlow(page = 1, pageSize = 10, data = {}) {
    return request({
        url: '/mobile/sealnoFlow/findMyLaunchSealnoFlow',
        method: 'get',
        params: {
            page,
            pageSize,
            ...data
        }
    })
}

// 获取我的待办记录
export function findMyToDoSealnoFlow(page = 1, pageSize = 10, data = {}) {
    return request({
        url: '/mobile/sealnoFlow/findMyToDoSealnoFlow',
        method: 'get',
        params: {
            page,
            pageSize,
            ...data
        }
    })
}

// 获取我的实施记录
export function findMyOperatorSealnoFlow(page = 1, pageSize = 10, data = {}) {
    return request({
        url: '/mobile/sealnoFlow/findMyOperatorSealnoFlow',
        method: 'get',
        params: {
            page,
            pageSize,
            ...data
        }
    })
}

// 获取申报详情
export function findMySealnoFlowDetail(id) {
    return request({
        url: `/mobile/sealnoFlow/findMySealnoFlowDetail/${id}`,
        method: 'get'
    })
}

// 新增异常施封业务提交提交
export function submitApprovalSpecial(id, status, applyDescription, businessNo, deviceId, opUserId) {
    return request({
        url: '/mobile/sealnoFlow/submitApproval',
        method: 'post',
        data: {
            id,
            status,
            applyDescription,
            businessNo,
            deviceId,
            opUserId
        }
    });
}

// 新增采购业务提交提交
export function submitApprovalBuy(id, status, applyDescription) {
    return request({
        url: '/callback/system/sealnoPlan/approved',
        method: 'post',
        data: {
            id,
            status,
            applyDescription
        }
    });
}

// 获取铅封下所有申报
export function findAllFlowBySnCode(snCode) {
    return request({
        url: `/mobile/sealnoFlow/findAllFlowBySnCode/${snCode}`,
        method: 'get'
    })
}

// 新增异常上报
export function addSealnoFlow(data) {
    return request({
        url: '/mobile/sealnoFlow/addSealnoFlow',
        method: 'post',
        data
    })
}

export function updateFlowStatus(id, status) {
    return request({
        url: `/mobile/sealnoFlow/updateFlowStatus/${id}`,
        method: 'get',
        params: {
            status
        }
    })
}

export function findMyToDoNumber() {
    return request({
        url: `/mobile/sealnoFlow/findMyToDoNumber`,
        method: 'get'
    })
}
